/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vng.zing.survey.data;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 *
 * @author kienpd
 */
public class Base {
    public static String cofigid ="#bnum=2000000"+"#apow=17" + "#fpow=10"+"#opts=HashDB::TSMALL|HashDB::TLINEAR"+"#dfunit=8"+"#msiz=125000000";
    public static String cofigdata="#bnum=2000000"+"#apow=11"+"#fpow=10"+"#opts=HashDB::TSMALL|HashDB::TLINEAR"+"#dfunit=8"+"#msiz=125000000";
           
      public static byte[] serialize(Object obj) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ObjectOutputStream os = new ObjectOutputStream(out);
        os.writeObject(obj);
        return out.toByteArray();
    }

    public static Object deserialize(byte[] data) throws IOException, ClassNotFoundException {
        ByteArrayInputStream in = new ByteArrayInputStream(data);
        ObjectInputStream is = new ObjectInputStream(in);
        return is.readObject();
    }
    
}
